'use strict';
angular.module('app', [
    'app.filters', 
    'app.services', 
    'app.directives', 
    'app.controllers', 
    'ui.bootstrap', 
    'ngCookies', 
    'ngRoute', 
    'ui.select2', 
    'ngStorage', 
    'geocoder', 
    'datePicker', 
    'underscore', 
    'angular-gestures'
]).config([
    '$routeProvider', 
    '$locationProvider', 
    '$httpProvider', 
    function ($routeProvider, $locationProvider, $httpProvider) {
        $routeProvider.when('/Teams/:id', {
            templateUrl: 'scripts/app/teamdetails.view.html',
            controller: 'teamDetailCtrl'
        }).when('/Incidents/:id', {
            templateUrl: 'scripts/app/incidentdetail.view.html',
            controller: 'incidentDetailCtrl'
        }).when('/LocationDetail/:id', {
            templateUrl: 'scripts/app/locationdetail.view.html',
            controller: 'locationDetailCtrl'
        }).when('/LocationDetail/:id/:id2', {
            templateUrl: 'scripts/app/locationdetail.view.html',
            controller: 'locationDetailCtrl'
        }).when('/Victims/:id', {
            templateUrl: 'scripts/app/victims.view.html',
            controller: 'victimsCtrl'
        }).when('#/Victims/:id', {
            templateUrl: 'scripts/app/victims.view.html',
            controller: 'victimsCtrl'
        }).when('#/LocationDetail/:id', {
            templateUrl: 'scripts/app/locationdetail.view.html',
            controller: 'locationDetailCtrl'
        }).when('#/LocationDetail/:id/:id2', {
            templateUrl: 'scripts/app/locationdetail.view.html',
            controller: 'locationDetailCtrl'
        }).when('#/Teams', {
            templateUrl: 'scripts/app/teams.view.html',
            controller: 'teamCtrl'
        }).when('/Teams', {
            templateUrl: 'scripts/app/teams.view.html',
            controller: 'teamCtrl'
        }).when('/Incidents', {
            templateUrl: 'scripts/app/incident.view.html',
            controller: 'incidentCtrl'
        }).when('#/Incidents', {
            templateUrl: 'scripts/app/incident.view.html',
            controller: 'incidentCtrl'
        }).when('/', {
            templateUrl: 'scripts/app/home.view.html',
            controller: 'homeCtrl'
        }).when('#/', {
            templateUrl: 'scripts/app/home.view.html',
            controller: 'homeCtrl'
        }).when('#/About', {
            templateUrl: 'scripts/app/about.view.html',
            controller: 'aboutCtrl'
        }).when('/About', {
            templateUrl: 'scripts/app/about.view.html',
            controller: 'aboutCtrl'
        }).when('/Admin/:id', {
            templateUrl: 'scripts/app/admin.view.html',
            controller: 'adminCtrl'
        }).when('#/404', {
            templateUrl: 'scripts/app/404.html'
        }).otherwise({
            redirectTo: 'scripts/app/home.view.html'
        });
        var $http;
    }]).value('toastr', this.window.toastr).run([
    '$rootScope', 
    '$location', 
    function ($rootScope, $location) {
        $rootScope.$on("$routeChangeStart", function (event, next, current) {
            $rootScope.error = null;
        });
    }]);
